import pandas as pd
import sys
try:
    sheet = pd.read_excel("/Users/wangshuguan/Desktop/建筑宝数据结构.xls", '原目录', index_col=None, na_values=['NA'], header=0)
except IOError:
    print("无法打开文件")
    sys.exit()
print(sheet.columns.to_numpy())
# for x in sheet.columns:
#     print(x)

# for x in sheet.values:
#     print(x)

# print(sheet["姓名"][0])

# print(sheet.columns)
# print(sheet["部室"])
# print(sheet.values)
# print(sheet.loc[0:3,["部室","姓名"]])#第0行的两个字段内容
# print(sheet.iloc[[0,1,2,3],[0,1]])#逐个读取
# print(sheet.iloc[:4,:2])#批量加，其实小于
# print(sheet.部室)#还可以用中文找到某列
# print(sheet[pd.notna(sheet.部室)])#还可以用bool来过滤数据


